import java.util.Scanner;
class Solution {
    public int firstUniqChar(String s) {
        char[] sc = s.toCharArray();
        for (int i = 0; i < sc.length; i++) {
            int n =s.indexOf(sc[i]);
            int m = s.indexOf(sc[i],i+1);
            if (n == i&&m == -1) {
                return i;
            }
        }
        return -1;
    }
}
public class TestMain1 {

    public static void main(String[] args) {
        Solution so = new Solution();
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        System.out.println( so.firstUniqChar(s));
    }
}
